//
//  QQHelper.h
//  ShareTest
//
//  Created by Eric Wang on 15/1/31.
//  Copyright (c) 2015年 LinkMob. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <TencentOpenAPI/TencentOAuth.h>
#import <TencentOpenAPI/QQApiInterface.h>
#import <TencentOpenAPI/QQApiInterfaceObject.h>

@protocol QQDelegate <NSObject>
// 其他Delegate课参考TencentSessionDelegate
@required
- (void)qqLoginSuccessful:(TencentOAuth *)tencentOAuth;
- (void)qqLoginUnsuccessful:(BOOL)cancelled;
- (void)qqLoginNotNetwork;

@optional
- (void)getUserInfo:(APIResponse *)userInfoResponse;

@end

typedef NS_ENUM(NSInteger, ShareType) {
    QQShareTypeText = 0,
    QQShareTypeImage,
    QQShareTypeNews,
    QQShareTypeAudio,
    QQShareTypeVideo
};

@interface QQHelper : NSObject <TencentSessionDelegate>

@property (nonatomic, assign) id<QQDelegate> delegate;
@property (nonatomic, strong) TencentOAuth *tencentOAuth; // 腾讯OAuth


+ (instancetype)shareInstance;

//
// 纯文本和纯图片内容不支持分享到Qzone
//

/**
 * @brief 分享
 *
 * @param title 标题
 * @param text 文本内容
 * @param imgData 本地图片
 * @param imgURL 网络图片
 * @param description 内容描述
 * @param url 跳转URL
 * @param flashURL 网络流媒体（分享音乐用）
 * @param type 类型
 * @param Qzone 分享到好友还是QQ空间
 */
- (void)shareTitle:(NSString *)title
              text:(NSString *)text
           imgData:(NSData *)imgData
            imgURL:(NSString *)imgURL
       description:(NSString *)desc
               url:(NSString *)url
          flashURL:(NSString *)flashURL
              type:(ShareType)type
             QZone:(BOOL)Qzone;

+ (NSData *)imageWithPath:(NSString *)imageFilePath;
+ (NSURL *)imageWithURL:(NSString *)imageUrl;

@end
